<template>
  <div>
    <!-- 登录状态 -->
    <div class="top login">
      <!-- 头像部分 -->
      <div class="top-content">
        <div class="left">
          <van-image
            round
            src="https://img01.yzcdn.cn/vant/cat.jpeg"
            class="avatar"
          />
          <span>账户名称</span>
        </div>
        <div class="right">
          <van-button type="default" round size="mini">编辑资料</van-button>
        </div>
      </div>
      <div class="button-content">
        <div>
          <span class="count">0</span>
          <span class="title">头条</span>
        </div>
        <div>
          <span class="count">0</span>
          <span class="title">关注</span>
        </div>
        <div>
          <span class="count">0</span>
          <span class="title">粉丝</span>
        </div>
        <div>
          <span class="count">0</span>
          <span class="title">获赞</span>
        </div>
      </div>
    </div>

    <!-- 未登录状态 -->
    <div class="top not-login">
      <div class="content">
        <img src="../../assets/imgs/mobile.png" alt="">
        <span>登录 / 注册</span>
      </div>
    </div>

    <!-- 收藏/历史导航栏 -->
    <van-grid clickable :column-num="2">
      <!-- 使用插槽的方式设置icon图标样式 -->
      <van-grid-item text="收藏" to="" >
        <template #icon>
          <van-icon name="star-o" color="#eb5253"/>
        </template>
      </van-grid-item>
      <!-- 穿透设置图标样式 :deep(选择器) -->
      <van-grid-item icon="underway-o" text="历史" to="" />
    </van-grid>

    <!-- 菜单列表 -->
   <div class="list">
      <van-cell title="消息通知" is-link to="" />
      <van-cell title="小智同学" is-link to="" />
   </div>

   <!-- 推出登录 -->
   <div class="out-login">退出登录</div>
  </div>
</template>

<script>
export default {
  name: 'MyIndex'
}
</script>

<style scoped lang='less'>
// background: 背景颜色   背景图片   是否平铺  背景位置 / 背景大小
// 头部面板样式
.top {
  width: 375px;
  height: 180px;
  background: url(../../assets/imgs/banner.png) no-repeat 0 0/ cover;
  position: relative;
}
.login {
  .top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px;
    .left {
      display: flex;
      align-items: center;
      .avatar {
      width: 66px;
      height: 66px;
      margin-right: 10px;
      }
      span {
        font-size: 15px;
        color: #ffffff;
      }
    }
  .right {
    span {
      font-size: 12px;
    }
  }
  }
  .button-content {
    display: flex;
    justify-content: space-around;
    div {
      display: flex;
      flex-direction: column;
      align-items: center;
      color: #ffffff;
      .count {
        font-size: 20px;
      }
      .title {
        font-size: 14px;
      }
    }
  }
}
.not-login {
  .content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    span {
      display: block;
      font-size: 14px;
      color: #ffffff;
    }
    img {
    width: 66px;
    height: 66px;
    }
  }
}
// 穿透设置样式
:deep(.van-icon-underway-o) {
  color: #ff9d1d;
}
.list {
  margin-top: 5px;
}
.out-login {
  width: 100%;
  height: 45px;
  margin-top: 5px;
  background-color: #fff;
  line-height: 45px;
  text-align: center;
  font-size: 15px;
  color: #d86262;
}
</style>
